<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
        let num1 = '12.345dsasz';
        let num2 =Number(num1);
        console.log(num2);            //NaN: not a number
        console.log(typeof(num2));
        let num3 = parseInt(num1); num4 = parseFloat(num1);
        console.log(num3);
        console.log(num4);
        console.log('------转字符型-------');
        let str1 = null;str2 = undefined,str3 =true,str4 = 123.56;
        console.log(String(str1));
        console.log(str3.toString());
        //console.log(str1.toString());  //报错
        console.log('--------运算符-------');
        let n1 = 1234, n2 = 4231.3,n3 ='hello',n4 = true;
        let re1 = n1+n2;
        let re2 = n1+n3;
        let re3 = n3+n4;
        console.log(re1);
        console.log(re2);
        console.log(re3);
        console.log('--------自增-------');
       // 自增/自减在前:先自增/自减,再运算;
       // 自增/自减在后:先运算，再自增/自减;
        let  a = 4, b = 0;
        let res1 = a+++--b+a-b;    //4+(-1)+5-(-1)=9
        console.log(res1);
        console.log('--------赋值--------');
        let a1 =9, a2 = 2;
        a1<<=a2
        console.log(a1);
        console.log(a2);
        console.log('---------------');
        let x = 123,y = '123';
        console.log(x==y);   //true,等于。符号两边会自动进行数据类型转换
        console.log(x===y);  //false，全等于。符号两边不会进行数据类型转换
    </script>
</html>